package com.jiangds.open.check.checker;

import com.jiangds.open.check.Checker;
/**
 * {@link DoubleChecker}  double校验框架
 *
 * @author jiangliang
 * @since 2021/1/5 16:11
 */
public class DoubleChecker extends AbstractChecker<Double,Double> {

    public DoubleChecker(Double target) {
        super(target);
    }

    @Override
    public Checker<Double, Double> notEmpty() {
        return notNull();
    }

    @Override
    public Checker<Double, Double> range(Double min, Double max) {
        return processor(t-> t>=min && t<=max);
    }

    @Override
    public Checker<Double, Double> greater(Double greaterThan) {
        return processor(t-> t >= greaterThan);
    }

    @Override
    public Checker<Double, Double> in(Double... args) {
        return inProcessor(Double::equals,args);
    }

    @Override
    public Checker<Double, Double> less(Double lessThan) {
        return processor(t-> t <= lessThan);
    }

}
